package m4d1;

import java.io.FileNotFoundException;
import java.io.PrintStream;

//打印流  只负责数据的输出，不负责读取  继承了OutputStream
public class aPrintStream {
    public static void main(String[] args) throws FileNotFoundException {
        PrintStream ps = new PrintStream("day02\\src\\m4d1\\b.txt");

        //用父类的write方法会查询编码表
        ps.write(97);
        ps.println(97+"ahahah");

        //改变输出语句的目的地为打印流的目的地
        System.setOut(ps);
        System.out.println("打印了");

        ps.close();

    }
}
